package com.link2room.jetfire.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

@Entity
@Table(name = "reservation_promotion", schema = "ark_order_dev", catalog = "")
@DynamicInsert
public class ReservationPromotion extends BaseEntity{
    private String l2RNo;
    private String promotionType;
    private BigDecimal promotionValue;
    private BigDecimal amount;
    private String descript;
    private String promotionCode;
    private String promotionNo;
    private String extend;

    @Basic
    @Column(name = "l2r_no")
    public String getL2RNo() {
        return l2RNo;
    }

    public void setL2RNo(String l2RNo) {
        this.l2RNo = l2RNo;
    }

    @Basic
    @Column(name = "promotion_type")
    public String getPromotionType() {
        return promotionType;
    }

    public void setPromotionType(String promotionType) {
        this.promotionType = promotionType;
    }

    @Basic
    @Column(name = "promotion_value", precision = 2)
    public BigDecimal getPromotionValue() {
        return promotionValue;
    }

    public void setPromotionValue(BigDecimal promotionValue) {
        this.promotionValue = promotionValue;
    }

    @Basic
    @Column(name = "amount", precision = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "descript")
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ReservationPromotion that = (ReservationPromotion) o;

        if (l2RNo != null ? !l2RNo.equals(that.l2RNo) : that.l2RNo != null) return false;
        if (promotionType != null ? !promotionType.equals(that.promotionType) : that.promotionType != null)
            return false;
        if (promotionValue != null ? !promotionValue.equals(that.promotionValue) : that.promotionValue != null)
            return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        return descript != null ? descript.equals(that.descript) : that.descript == null;
    }

    @Override
    public int hashCode() {
        int result = l2RNo != null ? l2RNo.hashCode() : 0;
        result = 31 * result + (promotionType != null ? promotionType.hashCode() : 0);
        result = 31 * result + (promotionValue != null ? promotionValue.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "promotion_code", nullable = true, length = 32)
    public String getPromotionCode() {
        return promotionCode;
    }

    public void setPromotionCode(String promotionCode) {
        this.promotionCode = promotionCode;
    }

    @Basic
    @Column(name = "promotion_no", nullable = true, length = 64)
    public String getPromotionNo() {
        return promotionNo;
    }

    public void setPromotionNo(String promotionNo) {
        this.promotionNo = promotionNo;
    }

    @Basic
    @Column(name = "extend", nullable = true, length = 1000)
    public String getExtend() {
        return extend;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }
}
